<?php
/* @var $this ReservationController */
/* @var $model Reservation */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'reservation-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>


	<div class="row">
		<?php echo $form->labelEx($model,'service_id'); ?>
		<?php echo $form->dropDownList($model, 'service_id', CHtml::listData(
		Service::model()->findAll(), 'id', 'type'),
		array('prompt' => 'Select Service')); ?>
		<?php echo $form->error($model,'service_id'); ?>
	</div>

	<div class="row">
    <?php echo $form->labelEx($model,'reservation_date'); ?>
	<?php $this->widget('ext.EJuiDateTimePicker',
		array(
        'model'     => $model,
        'attribute' => 'reservation_date',
        'language'=> 'en',//default Yii::app()->language
        'mode'    => 'date',//'datetime' or 'time' ('datetime' default)
        'options'   => array(
            'dateFormat' => 'yy.mm.dd',
            //'timeFormat' => '',//'hh:mm tt' default
			),
		));?>
      <?php echo $form->error($model,'reservation_date'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'reservation_time'); ?>
		<?php $this->widget('ext.EJuiDateTimePicker',
		array(
        'model'     => $model,
        'attribute' => 'reservation_time',
        'language'=> 'en',//default Yii::app()->language
        'mode'    => 'time',//'datetime' or 'time' ('datetime' default)
        'options'   => array(
            //'dateFormat' => 'dd/mm/yy',
            'timeFormat' => 'hh:mm',//'hh:mm tt' default
			),
		));?>
		<?php echo $form->error($model,'reservation_time'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'reservation_type'); ?>
		<?php echo $form->dropDownList($model,'reservation_type', array('Walk In' => 'Walk In', 'Home Service' => 'Home Service'),
		array('prompt'=>'Select Reservation Type') ); ?>
		<?php echo $form->error($model,'reservation_type'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'start_time'); ?>
		<?php $this->widget('ext.EJuiDateTimePicker',
		array(
        'model'     => $model,
        'attribute' => 'start_time',
        'language'=> 'en',//default Yii::app()->language
        'mode'    => 'time',//'datetime' or 'time' ('datetime' default)
        'options'   => array(
            //'dateFormat' => 'dd/mm/yy',
            'timeFormat' => 'hh:mm',//'hh:mm tt' default
			),
		));?>
		<?php echo $form->error($model,'start_time'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'end_time'); ?>
		<?php $this->widget('ext.EJuiDateTimePicker',
		array(
        'model'     => $model,
        'attribute' => 'end_time',
        'language'=> 'en',//default Yii::app()->language
        'mode'    => 'time',//'datetime' or 'time' ('datetime' default)
        'options'   => array(
            //'dateFormat' => 'dd/mm/yy',
            'timeFormat' => 'hh:mm',//'hh:mm tt' default
			),
		));?>
		<?php echo $form->error($model,'end_time'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'attendant_id'); ?>
		<?php echo $form->dropDownList($model, 'attendant_id', CHtml::listData(
		Attendant::model()->findAll(), 'id', 'fname'),
		array('prompt' => 'Select Attendant')); ?>
		<?php echo $form->error($model,'attendant_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'bed_id'); ?>
		<?php echo $form->dropDownList($model, 'bed_id', CHtml::listData(
		Bed::model()->findAll(), 'id', 'bed_name'),
		array('prompt' => 'Select Bed')); ?>
		<?php echo $form->error($model,'bed_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'reservation_status'); ?>
		<?php echo $form->dropDownList($model,'reservation_status', array('Confirmed' => 'Confirmed', 'Cancelled' => 'Cancelled'),
		array('prompt'=>'Select Status') ); ?>
		<?php echo $form->error($model,'reservation_status'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Reserve' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->